package malus.shaofeng.com.beiwomusic.model;

import org.json.JSONObject;

/**
 * 故事内容的评论
 */
public class Comment {
    private int comment_id;
    private String content;
    private String nickname;
    private String create_time;
    private User user;
    private RefComment ref_comment;
    public void parseJSON(JSONObject object){
        this.comment_id=object.optInt("comment_id");
        this.content=object.optString("content");
        this.nickname=object.optString("nickname");
        this.create_time=object.optString("create_time");
        this.user=new User();
        JSONObject userJSON = object.optJSONObject("user");
        if(userJSON!=null){
            user.parseJSON(userJSON);
        }
        this.ref_comment=new RefComment();
        JSONObject refJSON = object.optJSONObject("user");
        if(refJSON!=null){
            ref_comment.parseJSON(refJSON);
        }
    }

    public int getComment_id() {
        return comment_id;
    }

    public void setComment_id(int comment_id) {
        this.comment_id = comment_id;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getCreate_time() {
        return create_time;
    }

    public void setCreate_time(String create_time) {
        this.create_time = create_time;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public RefComment getRef_comment() {
        return ref_comment;
    }

    public void setRef_comment(RefComment ref_comment) {
        this.ref_comment = ref_comment;
    }
}

